package phase2.view;

import javax.faces.context.FacesContext;

import oracle.binding.BindingContainer;
import oracle.binding.OperationBinding;

import oracle.jbo.ApplicationModule;

public class JugeBean
{
  private BindingContainer bindings;

  public JugeBean()
  {
  }
  
  public boolean isJudge()
  {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("isJudge");
    return ((Boolean)operationBinding.execute()).booleanValue();
  }

  public BindingContainer getBindings()
  {
    if (this.bindings == null)
    {
      FacesContext fc = FacesContext.getCurrentInstance();
      this.bindings =
          (BindingContainer) fc.getApplication().evaluateExpressionGet(fc, "#{bindings}",
            BindingContainer.class);
    }
    return this.bindings;
  }
}
